from building import *

cwd = GetCurrentDir()
CPPPATH = [cwd]
src = []

if GetDepend('SUPPORT_I2C_DEV_IO'):
    src += Glob('I2cDev_IO.c') 
elif GetDepend('SUPPORT_I2C_DEV_LPC'):
    src += Glob('I2cDev_LPC.c') 
elif GetDepend('SUPPORT_I2C_DEV_STM32'):
    src += Glob('I2cDev_STM32.c') 
elif GetDepend('SUPPORT_I2C_DEV_HC32M0'):
    src += Glob('I2cDev_HC32M0.c') 

if GetDepend('SUPPORT_I2C_MNG'):
    src += Glob('I2cMng.c') 
    if GetDepend('SUPPORT_I2C_MNG_STM32_123'):
        src += Glob('I2cMng_cbSTM32_123.c')  

if GetDepend('SUPPORT_I2C_INSTANCE'):
    if GetDepend('SUPPORT_I2C_INSTANCE_LPC_1'):
        src += Glob('I2c_LPC_1.c')  

if GetDepend('SUPPORT_I2C_DEV_CMD'):
    src += Glob('I2cDev_Cmd.c') 

if GetDepend('SUPPORT_I2C_SIO'):
    src += Glob('I2CSio.c') 

#增加SUPPORT_EX_PREINCLUDE定义以预包含Preinclude.h
predefine = ['SUPPORT_EX_PREINCLUDE']
group = DefineGroup('i2c', src, depend = [''], CPPPATH=CPPPATH, CPPDEFINES = predefine)
Return('group')